package com.qa.clients;

import com.qa.clients.fallback.QuestionClientFallBackFactory;
import com.qa.common.result.Result;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.DeleteMapping;
import org.springframework.web.bind.annotation.PathVariable;

@FeignClient(name = "question-service", url = "http://localhost:8091/question/user/questions",
        fallbackFactory = QuestionClientFallBackFactory.class)
public interface QuestionClient {
    /**
     * 删除该分类下的所有题目
     *
     * @param categoryId 分类id
     * @return Result
     */
    @DeleteMapping("/deleteAll/{categoryId}")
    Result deleteAllQuestionsOfCategory(@PathVariable("categoryId") Long categoryId);
}
